#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#define MaxSize 100
typedef char DataType;
typedef struct {
	DataType data[MaxSize];
	int front;
	int rear;
}Queue;
void Init(Queue* &q)
{
	q = (Queue*)malloc(sizeof(Queue));
	q->front = q->rear = 0;
}
void Destroy(Queue* &q)
{
	free(q);
}
void Destroy(Queue* &q)
{
	free(q);
}
bool EmptyQueue(Queue* &q)
{
	return (q->front == q->rear);
}
bool EnQueue(Queue* &q,DataType e)
{
	if ((q->rear + 1) % MaxSize == q->front)
		return false;
	q->rear = (q->rear + 1) % MaxSize;
	q->data[q->rear] = e;
	return true;
}
bool EnQueue(Queue* &q,DataType e)
{
	if ((q->rear + 1) % MaxSize == q->front)
		return false;
	q->rear = (q->rear + 1) % MaxSize;
	q->data[q->rear] = e;
	return true;
}
bool DeQueue(Queue* &q,DataType &e)
{
	if (q->front == q->rear)
		return false;
	e = q->data[q->front];
	q->front = (q->front + 1) % MaxSize;
	return true;
}